<table class="table table-bordered table-striped table-hover">
	<tr>
		<th></th>
		<th colspan="3">{{ $month.'月销售(当月)' }}</th>
		<th colspan="3">{{ $year.'年度指标' }}</th>
		<th colspan="3">{{ $year.'年销售（全年）' }}</th>
		<th colspan="4">{{ $year.'年度指标进度' }}</th>
    </tr>
    <tr>
		<th>大区</th>
		<th>01热水器</th>
		<th>02厨房</th>
		<th>03采暖</th>
		<th>01热水器</th>
		<th>02厨房</th>
		<th>03采暖</th>
		<th>01热水器</th>
		<th>02厨房</th>
		<th>03采暖</th>
		<th>01热水器</th>
		<th>02厨房</th>
		<th>03采暖</th>
		<th>总计</th>
    </tr>
  @forelse($report_invoice_region_contract->regions as $region)
	<tr>
		<td>{{ $region->code_desc }}</td>
		<td>{{ number_format($region->getInvoiceMonthContractById(1, $month), 2) }}</td>
		<td>{{ number_format($region->getInvoiceMonthContractById(3, $month), 2) }}</td>
		<td>{{ number_format($region->getInvoiceMonthContractById(4, $month), 2) }}</td>
		<td>{{ number_format($region->getInvoiceTargetById(1), 2) }}</td>
		<td>{{ number_format($region->getInvoiceTargetById(3), 2) }}</td>
		<td>{{ number_format($region->getInvoiceTargetById(4), 2) }}</td>
		<td>{{ number_format($region->getInvoiceRealYearByContract(1), 2) }}</td>
		<td>{{ number_format($region->getInvoiceRealYearByContract(3), 2) }}</td>
		<td>{{ number_format($region->getInvoiceRealYearByContract(4), 2) }}</td>
		<td>{{ round_percent($region->invoiceProgress(1)) }}</td>
		<td>{{ round_percent($region->invoiceProgress(3)) }}</td>
		<td>{{ round_percent($region->invoiceProgress(4)) }}</td>
		<td>{{ round_percent($region->invoiceProgressTotal([1,3,4])) }}</td>
	</tr>
  @empty
  	<tr><td>暂无数据</td></tr>
  @endforelse
	<tr>
		<th>合计</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceMonthContractById(1), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceMonthContractById(3), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceMonthContractById(4), 2) }}</th>

		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceTargetYearByContract(1), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceTargetYearByContract(3), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceTargetYearByContract(4), 2) }}</th>
		
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceRealYearByContract(1), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceRealYearByContract(3), 2) }}</th>
		<th>{{ number_format($report_invoice_region_contract->getTotalInvoiceRealYearByContract(4), 2) }}</th>


		<th>{{ round_percent($report_invoice_region_contract->totalInvoiceProgressByContract(1)) }}</th>
		<th>{{ round_percent($report_invoice_region_contract->totalInvoiceProgressByContract(3)) }}</th>
		<th>{{ round_percent($report_invoice_region_contract->totalInvoiceProgressByContract(4)) }}</th>
		<th>{{ round_percent($report_invoice_region_contract->totalInvoiceProgressByContracts([1,3,4])) }}</th>
	</tr>
</table>